#ifndef _MAP_H_
#define _MAP_H_
#include <map>
#include <vector>
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
/*
*http://www.yitsoft.com/chap_study/ch_00029/ch_00029.asp
*/
using namespace std;

#if 0
map<string,int> mapword[MaxMap];                //initialization ten mapword for every file in folder
map<string,int> spam_map;                         //store the spam mail words
map<string,int> pam_map;                          //store the legitimate mail
map<string,int> mailmap;

typedef pair<string,int> pair_map;
vector<pair_map> tVector;
#endif

int InsertMap(char *str,map<string,int>mapword[],int index);

int InsertMapStr(char *str,map<string,int>&mailmap);

void FindMapWord(char *str,map<string,int>mapword[],int index);

void FindMapWordStr(char *str,map<string,int>&mailmap);

void MapWordSize(int index,map<string,int>mapword[]);

int MapWordSizeStr(map<string,int>&mailmap);

void PrintfMap(int filecounts,map<string,int>mapword[]);

void ClearMapWord(int index,map<string,int>mapword[]);

void DeleteMMap(int N,map<string,int>mapword[]);

void StatisticsMapWords(map<string,int> &result_map,int N,map<string,int>mapword[]);

void PrintfResult_map(map<string,int> &result_map);

int cmp(const pair<string,int>& x,const pair<string,int>& y);

void sortMapByValue(map<string,int>& mailmap,vector< pair<string,int> >& tVector);

int FindWordNumsLib(char *word,map<string,int>maillib);

#endif
